<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		用JS或JQ实现
		1、随机从44个人，抽取一个
		2、抽过的同学不能再被抽取到
		<div>
			未抽取的同学名单
		</div>
		<span id="span_wx"></span>
		<div>
			<button type="button">抽取</button>
		</div>

		<div>
			已抽取的同学名单
		</div>
		<span id="span_yx"></span>
		<script src="../jquery-datatables-1.10.15/jquery-1.10.2.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(function() {
				//是在页面加载完毕后执行
				let array = ["莫少聪",
					"陆宣容",
					"蒙丹荔",
					"吴添昊",
					"于文霞",
					"彭石源",
					"覃荣君",
					"杨启婷",
					"赵一莲",
					"梁秀梅",
					"李烨健",
					"韦航",
					"蒙贞吉",
					"李宏盛",
					"黄键华",
					"莫瑛玮",
					"罗丽菊",
					"陆柳荣",
					"蓝宏金",
					"黄小燕",
					"卢祖镇",
					"赖俊基",
					"刘家梅",
					"韦忠锦",
					"叶鹏",
					"陈汉华",
					"陈昱伶",
					"覃泉霖",
					"金磊",
					"岑松峻",
					"陈桂民",
					"陈银银",
					"蒙林燕",
					"周刚鸿",
					"姚灿林",
					"杨勇辉",
					"吴晖",
					"陈家有",
					"谢世杰",
					"潘家盛",
					"姜家璇"
				];
				
				let yxArr = [];//已被抽取的名单
				$("#span_wx").text(array.toString());
				$("button").click(function() {
					//随机产生[0, array.length - 1]
					let len = array.length - 1;
					if(!len) {
						return;
					}
					//Math.random() * len产生是float
					let index = Math.floor(Math.random() * len);//得到整数
					//获取被抽取到的同学名称
					let name = array[index];
					//保存到yxArr数组中
					yxArr.push(name);
					//将已抽取的名单显示在dom元素上
					$("#span_yx").text(yxArr.toString());
					//删除
					array.splice(index, 1);
				});
			})
		</script>
	</body>
</html>
